<?php 
require_once dirname(__FILE__).'/simple_html_dom.php';

header('Content-Type: text/html; charset=UTF-8');
// header("Content-Type:text/xml");

$html = new simple_html_dom();
//$html->load_file('http://www.soweather.com/');//load url
$html->load_file('http://www.qiyadeng.com/weather/a.html');
$todayWeather001 = $html->find(".TodayWeather001s");
$d002s = $html->find(".d002s",0);
echo $d002s->plaintext ."<br/>";

$theData = array();
//echo $todayWeather001[0];
foreach($todayWeather001[0]->find('tr') as $row) {
	$tdCount = 0;
	foreach($row->find('td') as $cell) {
	//echo $cell->plaintext . "<br/>";
	$temp = str_replace("&nbsp;","", $cell->plaintext);
	if(!empty($temp)&&strlen(trim($temp))>0){

		$result = str_replace(" ", "",trim($temp));
		$theData[] = $result;
	}
	 
	 //$theData[] = $cell->plaintext;
// 		if($tdCount!=0){
// 			echo $cell->innerText;
// 		}
	//print_r($cell);
	 $tdCount++;	
	}
}

print_r($theData);

?>